<%@page import="POJO.NguoiDung"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>    
<%
	HttpSession httpSession = request.getSession();
	
	String tenND = "Guest";
	if(httpSession.getAttribute("nguoiDung")!=null)
	{
	    NguoiDung nguoiDung = (NguoiDung) httpSession.getAttribute("nguoiDung");
	    tenND = nguoiDung.getTenNguoiDung();
	}
%>    
    
<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<div id="top">
			<h1><a href="#">Online Shop</a></h1>
			<div id="top-navigation">
				Welcome <a href="#"><strong><%=tenND %></strong></a>
				<span>|</span><span>|</span>
				<% 
					if(tenND.equals("Guest"))
					    out.print("<a href='login'>Login</a>");
				%>
				<span>|</span><span>|</span>
				<a href="login?out=1">Log out</a>
			</div>
		</div>
		<!-- End Logo + Top Nav -->
		
		<!-- Main Nav -->
		<div id="navigation">
			<ul>			
			<%
			if (request.getAttribute("id") == null)
		    {
			    %>
			    <li><a href="DanhMucSanPham"><span>Danh mục sản phẩm</span></a></li>
			    <li><a href="SanPham"><span>Sản phẩm</span></a></li>
			    <li><a href="DonHang"><span>Đơn hàng</span></a></li>
			    <li><a href="KhachHang"><span>Khách hàng</span></a></li>
			    <li><a href="#" class="active"><span>Giới thiệu</span></a></li>
			<%		
		    }
			else
			{
			    String id = (String) request.getAttribute("id");
			    
			%>    
			    <li><a href="DanhMucSanPham" <%if(id.equals("1")) out.print("class='active'"); %>><span>Danh mục sản phẩm</span></a></li>
			    <li><a href="SanPham" <%if(id.equals("2")) out.print("class='active'"); %>><span>Sản phẩm</span></a></li>
			    <li><a href="DonHang" <%if(id.equals("3")) out.print("class='active'"); %>><span>Đơn hàng</span></a></li>
			    <li><a href="KhachHang" <%if(id.equals("4")) out.print("class='active'"); %>><span>Khách hàng</span></a></li>
			    <li><a href="#" <%if(id.equals("5")) out.print("class='active'"); %>><span>Giới thiệu</span></a></li>
			</ul>
			<%
			    
		    }
			%>
		</div>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->
